//
//  bangbangxiangqingViewController.m
//  wuyeviewcon
//
//  Created by dsdf on 16/1/18.
//  Copyright © 2016年 joey. All rights reserved.
//

#import "bangbangxiangqingViewController.h"
#import "YFInputBar.h"

@interface bangbangxiangqingViewController ()<YFInputBarDelegate>

@end

@implementation bangbangxiangqingViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    
    UIButton *button=[[UIButton alloc]init];
    button.frame=CGRectMake(0, 0, 375, 64);
    button.backgroundColor=[UIColor colorWithRed: 230/255.0 green:55/255.0 blue:55/255.0 alpha:1.0];
    [self.view addSubview:button];
    
    
    UILabel *labletext=[[UILabel alloc]init];
    labletext.frame=CGRectMake(155, 34, 66, 14);
    labletext.text=@"详情";
    labletext.adjustsFontSizeToFitWidth=YES;
    labletext.textColor=[UIColor whiteColor] ;
    [self.view addSubview:labletext];
    
    
    
    UIButton *button1=[[UIButton alloc]init ];//]WithFrame:CGRectMake(50, 50, 20, 20)];
    button1.frame=CGRectMake(22, 35, 20, 20);
    [button1 setBackgroundImage:[UIImage imageNamed:@"return@2x.png"] forState:UIControlStateNormal];
    [button1 addTarget:self action:@selector(fanhui:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:button1];
    
    
//    UIImageView *image=[[UIImageView alloc]initWithImage:@"邻里帮帮（详情）_02.png"];
//    image.frame=CGRectMake(0, 64, 375, 603);
//    [self.view addSubview:image];
//    
////
//    UIButton *button2=[[UIButton alloc]init ];//]WithFrame:CGRectMake(50, 50, 20, 20)];
//    button2.frame=CGRectMake(264,483,45,21);//, 35, 20, 20);
//    [button2 setBackgroundImage:[UIImage imageNamed:@"点击时状态点赞@2x.png"] forState:UIControlStateNormal];
//    [button2 addTarget:self action:@selector(huantu:) forControlEvents:UIControlEventTouchUpInside];
//    [self.view addSubview:button2];
    
    UIButton *button3=[[UIButton alloc]init ];//]WithFrame:CGRectMake(50, 50, 20, 20)];
    button3.frame=CGRectMake(319,483,45,21);//, 35, 20, 20);
    [button3 setBackgroundImage:[UIImage imageNamed:@"未点击时信息回复@2x.png"] forState:UIControlStateNormal];
    [button3 addTarget:self action:@selector(showtext:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:button3];
    
    
    UIButton *checkbox4 = [UIButton buttonWithType:UIButtonTypeCustom];
    
    checkbox4.frame=CGRectMake(264,483,45,21);
    
    [checkbox4 setImage:[UIImage imageNamed:@"点赞未点击状态@2x.png"] forState:UIControlStateNormal];
    [checkbox4 setImage:[UIImage imageNamed:@"点击时状态点赞@2x.png"] forState:UIControlStateSelected];
    [checkbox4 addTarget:self action:@selector(checkboxClick:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:checkbox4];
    
    
    
    
    
    

    
    ////tanchuang

    
    UITapGestureRecognizer *tap1 = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(xiaoshi:)];
    tap1.cancelsTouchesInView = NO;
    [self.view addGestureRecognizer:tap1];
    
}
- (IBAction)fanhui:(id)sender {
    [self dismissModalViewControllerAnimated:YES];
}

- (IBAction)huantu:(id)sender {
    
    //[self dismissModalViewControllerAnimated:YES];
}

- (IBAction)xiaoshi:(id)sender {
    //[self dismissModalViewControllerAnimated:YES];
    NSLog(@"321");
    //YFInputBar *inputBar=[[YFInputBar alloc]init];
    //_inputBar.alpha=0;
    
}


    -(void)checkboxClick:(UIButton *)btn
    {
        btn.selected = !btn.selected;
    }
    

    




- (IBAction)showtext:(id)sender {
    
    
    
    
    
    
    
    YFInputBar *inputBar = [[YFInputBar alloc]init];
    inputBar.frame=      CGRectMake(0, ([UIScreen mainScreen].bounds.size.height)-57, [UIScreen mainScreen].bounds.size.width , 57);
    inputBar.backgroundColor = [UIColor colorWithRed:230 green:230 blue:230 alpha:0.0];//grayColor];
    inputBar.delegate = self;
    inputBar.clearInputWhenSend = YES;
    inputBar.resignFirstResponderWhenSend = YES;
    
    [self.view addSubview:inputBar];
    
   
    
    
    
}


- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

-(void)inputBar:(YFInputBar *)inputBar sendBtnPress:(UIButton *)sendBtn withInputString:(NSString *)str
{
    NSLog(@"%@",str);
}

-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    [self.view.subviews enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
        [((UIView*)obj) resignFirstResponder];
    }];
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
